<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<IEnumerable<TheWorldsWorst.ApiWrapper.Model.Question>>" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>Unanswered Questions - TWWSOC</title>
    <link rel="Stylesheet" href="../../Content/all.css" />
</head>
<body>
<div class="container">
    <div id="header">
        <div id="topbar">
        </div>
        <br class="cbt"/>
        <div id="hlogo">
            <a href="/"><img src="../../Content/img/logo.png" alt="The World's Worst StackOverflow Clone" /></a>
        </div>
        <%= StackOverflow.Api.ExampleApp.Views.Shared.Format.Header("unanswered") %>
    </div>
    <div id="content">
        <div id="mainbar-full">    
            <div id="subheader">
                <h2>Unanswered Questions</h2>
                <div id="tabs">
				    <a <% if("newest".Equals(ViewData["SortOrder"])){ %>class="youarehere"<% } %> href="/unanswered/?sortOrder=newest" title="newest unanswered questions">newest</a>
				    <a <% if("votes".Equals(ViewData["SortOrder"])){ %>class="youarehere"<% } %> href="/unanswered/?sortOrder=votes" title="highest voted unanswered questions">votes</a>
                </div>          
            </div>
        </div>
    
    <div id="questions">
    <%
       foreach (var q in Model)
       {
           Response.Write(StackOverflow.Api.ExampleApp.Views.Shared.Format.QuestionListing(q));
       }
    %>
    </div>
    <br class="cbt"/>
    <%
        if(!Request.QueryString.AllKeys.Contains("sortOrder"))
            Response.Write(StackOverflow.Api.ExampleApp.Views.Shared.Format.Pager("/unanswered", (int)ViewData["PageNum"], (int)ViewData["PageSize"], (((int)ViewData["PageSize"])==Model.Count())));
        else
            Response.Write(StackOverflow.Api.ExampleApp.Views.Shared.Format.Pager("/unanswered?sortOrder=" + (String)ViewData["sortOrder"], (int)ViewData["PageNum"], (int)ViewData["PageSize"], (((int)ViewData["PageSize"]) == Model.Count())));
    %>
    </div>
</div>
            
</body>
</html>